<template>
	<view class="common-list">
		<view class="common-item" v-for="item in postList" :key="item.id"
			@click="nologinJump(`/subpage/talentemployment/employment/postinfo?id=${item.id}`)">
			<view class="common-name">
				<text class="name-text">{{ item.stationName }}</text>
				<text class="text-color" v-if="item.salaryRange !== '面议'">{{ item.salaryRange }}元</text>
				<text class="text-color" v-else>面议</text>
				
			</view>
			<view class="common-label">
				<text>{{ item.stationEdu }}</text>
				<text>{{ item.stationLesson }}</text>
				<text>招{{ item.recruitsNumber }}人</text>
			</view>
			<view class="common-footer">
				<text class="foot-text">{{ item.companyInfo.compName }}</text>
				<text class="foot-address">{{ item.companyInfo.compAddr }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			dataArray: {
				type: Array,
				default: () => []
			},
		},
		data() {
			return {
				postList: []
			}
		},
		watch: {
			dataArray: {
				handler(newArr, oldArr) {
					if (newArr && newArr.length) {
						this.postList = newArr
					}	
				},
				immediate: true
			}
		}
	}
</script>

<style lang="scss">
	.common-list {
		// padding: 0 32rpx;
		box-sizing: border-box;
		.common-item {
			width: 100%;
			padding: 28rpx 32rpx 32rpx;
			margin-bottom: 24rpx;
			box-sizing: border-box;
			background: #FFFFFF;
			border-radius: 40rpx;
			.common-name {
				display: flex;
				margin-bottom: 20rpx;
				justify-content: space-between;
				.name-text {
					font-weight: 600;
					font-size: 32rpx;
					color: #34314F;
					line-height: 22px;
				}
				.text-color {
					font-weight: 500;
					font-size: 32rpx;
					color: #FF7F1C;
					line-height: 22px;
				}
			}
			.common-label {
				display: flex;
				flex-wrap: nowrap;
				margin-bottom: 24rpx;
				text {
					display: block;
					margin-right: 16rpx;
					padding: 4rpx 12rpx;
					font-size: 24rpx;
					color: #34314F;
					line-height: 32rpx;
					border-radius: 8rpx;
					background-color: #F4F4F4;
					box-sizing: border-box;
				}
			}
			.common-footer {
				display: flex;
				flex-wrap: nowrap;
				justify-content: space-between;
				.foot-text {
					font-weight: 400;
					font-size: 26rpx;
					color: rgba(52, 49, 79, 0.7);
					line-height: 32rpx;
				}
				.foot-address {
					font-weight: 400;
					font-size: 26rpx;
					color: rgba(52, 49, 79, 0.5);
					line-height: 32rpx;
				}
			}
		}
	}
</style>